using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.CrystalReports.Engine;
using Oracle.DataAccess.Client;using Oracle.DataAccess.Types;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Page.Request.QueryString["adwidth"] != null)
        {
            ((univNETLib)Session[modzGeneral.mUsu_codigo + "NetLib"]).screenWidth = int.Parse(Page.Request.QueryString["adwidth"].ToString());
            ((univNETLib)Session[modzGeneral.mUsu_codigo + "NetLib"]).screenHeight = int.Parse(Page.Request.QueryString["adheight"].ToString());
        }

        try
        {
            string appLicenca = System.Configuration.ConfigurationManager.AppSettings["AppVersion"];
            if (appLicenca == "L")
                Response.Redirect("DefaultLight.aspx");
        }
        catch { }

        try
        {
            #region Fixo Idioma Browser
            string Idioma = Request.UserLanguages[0];
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(Idioma);
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Idioma);
            #endregion

            btnSessionEnd.Text = Resources.Default.POPUP_BLOQ;   
        }
        catch { }

       // Server.Transfer("");
    }
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (Page.Request.Params["Link"] != null)
        {
            string mLink = Page.Request.Params["Link"].ToString();
            if (mLink.Trim() != "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "setLinkUrl", "setUrl('" + mLink.Replace("/" + modzGeneral.get_site_name() + "/", "") + "');", true);
            }
        }
    }
    protected void btnSessionEnd_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        //Response.Redirect("Login.aspx");
        Server.Transfer("Login.aspx"); 
    }
}
